// 重载运算符 输出类
#include <iostream>

using namespace std;

// 时间类
class Time
{
public:
    Time();
    Time(int h, int m, int s);
    Time(const Time & ob);
    ~Time();    
public:
    int mHour;
    int mMin;
    int mSec;
};

class Date:public Time
{
public:
    void showTime(void)
    {
        cout << this->mHour << " "\
             << this->mMin << " "\
             << this->mSec << endl;

        return;
    }
private:
    int a;
    int b;
};

int main(int argc, char **argv)
{

    Date d;
    d.showTime();

    cout << sizeof(Time) << endl;   // 12
    cout << sizeof(Date) << endl;   // 20
    return 0;
}



Time::Time()
{
    // 无参构造
    this->mHour = 0;
    this->mMin = 0;
    this->mSec = 0;
}

Time::Time(int h, int m, int s)
{
    // 有参构造
    this->mHour = h;
    this->mMin = m;
    this->mSec = s;
}

Time::Time(const Time & ob)
{
    // 拷贝构造
    this->mHour = ob.mHour;
    this->mMin = ob.mMin;
    this->mSec = ob.mSec;
}

Time::~Time()
{
    // 析构函数
}  
